<!DOCTYPE html>
<html>
<head>
    <include file="Include:meta"/>
    <title>添加发票-目的地运营集团数据管理平台</title>
    <include file="Include:style"/>
    <style>
        .w50 {
            width: 50px;
        }
    </style>
</head>
<body>
<include file="Include:header"/>
<include file="Include:left"/>
<div id="main">
    <div class="crumbs">
        <div class="crumbs-text">收款列表 > 添加发票</div>
    </div>
    <div id="content">
        <form action="__APP__/ContractBack/add_invoice" method="post" id="crmproject_add_form">
            <div class="form-main">
                <div class="form-title">添加发票</div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>发票编号</div>
                    <div class="input-item">
                        <input type="text" class="form-control w200" name="number" value="{$number}" autocomplete="off"
                               required readonly>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>关联项目</div>
                    <div class="input-item">
                        <input hidden name="project_id" value="{$res['project_id']}">
                        {$res_crm_project['project_num']}--{$res_crm_project['name']}
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>关联合同</div>
                    <div class="input-item">
                        <input hidden name="contract_id" value="{$res['contract_id']}">
                        {$res['number']}--{$res['file_name']}
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>发票号码</div>
                    <div class="input-item">
                        <textarea name="no" class="form-control w200"></textarea>
                        <br><span style="color: grey">连号号码用-连接，断号号码用,表示。例如 1000001-1000010,1000020,1000030</span>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>发票抬头</div>
                    <div class="input-item">
                        <input type="text" class="form-control w200" name="title" value="" autocomplete="off">
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>关联收款</div>
                    <div class="input-item">
                        <select name="back_id" class="form-control w200 required_select" autocomplete="off"
                                required>
                            <option value="{$res['back_id']}">第{$res['stage']}阶段</option>
                        </select>
                        <br>
                        <span>该阶段总金额：{:float_money($res['stage_money'])} &nbsp;&nbsp;已开票：{:float_money($ticket_money)}&nbsp; &nbsp;剩余：{:float_money($res['this_ticket_money'])}</span>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>开票金额</div>
                    <div class="input-item">
                        <input type="number" class="form-control w200" name="make_money"
                               max="{$res['this_ticket_money']}" value="{$res['this_ticket_money']}" autocomplete="off"
                               required>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>开票日期</div>
                    <div class="input-item">
                        <input type="text" name="make_date" value="{$today}"
                               class="form-control Wdate w200 required_text"
                               onClick="WdatePicker()" readonly autocomplete="off">
                        <span class="error-item">必填项</span>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label"><span class="asterisk">*</span>申请人</div>
                    <div class="input-item">
                        <select name="proposer" class="form-control w200 required_select" autocomplete="off"
                                required>
                            <option value="{:$_SESSION['dms_uid']}">{:$_SESSION['dms_username']}</option>
                            <foreach name="user_list" item="vo">
                                <option value="{$vo.id}">{$vo.username}</option>
                            </foreach>
                        </select>
                    </div>
                </div>
                <div class="form-item">
                    <div class="input-label">备注</div>
                    <div class="input-item">
                        <textarea name="remark" class="form-control w400" autocomplete="off"></textarea>
                    </div>
                </div>
            </div>
            <div class="form-btn-item"><input type="submit" value="提交" class="btn btn-submit">
                <button class="btn btn-default goback" type="button">返回</button>
            </div>
        </form>
    </div>
</div>
</body>
<include file="Include:javascript"/>
</html>